#include "ZigbusNumericIniState.h"

ZigbusNumericIniState::ZigbusNumericIniState()
    : ZigbusItem(-1, NUMERIC_INI_STATE_SIZE)
{
}

ZigbusNumericIniState::ZigbusNumericIniState(bool enabled)
    : ZigbusItem(-1, NUMERIC_INI_STATE_SIZE)
{
    if(enabled) setValue(0x01);
    else setValue(0x00);
}

ZigbusNumericIniState::ZigbusNumericIniState(const ZigbusNumericIniState &other)
    : ZigbusItem(other)
{
}

QString ZigbusNumericIniState::text() const
{
    if(getValue() == 0x01) return "on";
    else return "off";
}
